package red.yancloud.www.db.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import red.yancloud.www.internet.bean.BookEntity;
import red.yancloud.www.internet.bean.BookMarkEntity;

import red.yancloud.www.db.greendao.BookEntityDao;
import red.yancloud.www.db.greendao.BookMarkEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bookEntityDaoConfig;
    private final DaoConfig bookMarkEntityDaoConfig;

    private final BookEntityDao bookEntityDao;
    private final BookMarkEntityDao bookMarkEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bookEntityDaoConfig = daoConfigMap.get(BookEntityDao.class).clone();
        bookEntityDaoConfig.initIdentityScope(type);

        bookMarkEntityDaoConfig = daoConfigMap.get(BookMarkEntityDao.class).clone();
        bookMarkEntityDaoConfig.initIdentityScope(type);

        bookEntityDao = new BookEntityDao(bookEntityDaoConfig, this);
        bookMarkEntityDao = new BookMarkEntityDao(bookMarkEntityDaoConfig, this);

        registerDao(BookEntity.class, bookEntityDao);
        registerDao(BookMarkEntity.class, bookMarkEntityDao);
    }
    
    public void clear() {
        bookEntityDaoConfig.clearIdentityScope();
        bookMarkEntityDaoConfig.clearIdentityScope();
    }

    public BookEntityDao getBookEntityDao() {
        return bookEntityDao;
    }

    public BookMarkEntityDao getBookMarkEntityDao() {
        return bookMarkEntityDao;
    }

}
